﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VIPMaterialUtil {

    /// <summary>
    /// 天空盒6面
    /// </summary>
    /// <param name="material">材质</param>
    /// <param name="front">前</param>
    /// <param name="back">后</param>
    /// <param name="left">左</param>
    /// <param name="right">右</param>
    /// <param name="up">上</param>
    /// <param name="down">下</param>
    public static Material SixSidedMaterial(Material material,Texture front,Texture back, Texture left, Texture right, Texture up, Texture down) {
        Shader shader = Shader.Find("Skybox/6 Sided");
        material.shader = shader;
        material.SetTexture("_FrontTex", front);
        material.SetTexture("_BackTex", back);
        material.SetTexture("_LeftTex", left);
        material.SetTexture("_RightTex", right);
        material.SetTexture("_UpTex", up);
        material.SetTexture("_DownTex", down);
        //RenderSettings.skybox = material;
        return material;
    }

}
